package com.isorf.mapper;


import com.isorf.pojo.brand;
import com.isorf.pojo.teacher;
import com.isorf.pojo.type;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface typemapper {

    @Insert("insert into type values (#{typeid},#{shoestype},#{typestatus},#{typemarks})")
    int addtype(type type);


    @Select("select* from type")
    List<type> pageList();

    @Delete("delete from type where typeid=#{typeid}")
    int deletetype(Integer typeid);

    @Delete({
            "<script>",
            "DELETE FROM type WHERE typeid IN",
            "<foreach collection='list' item='typeid' open='(' separator=',' close=')'>",
            "#{typeid}",
            "</foreach>",
            "</script>"
    })
    int batchDelete(List<Integer> typeid);

    @Update("UPDATE type SET " +
            "shoestype = #{shoestype}, " +
            "typestatus = #{typestatus}, " +
            "typemarks = #{typemarks} " +
            "WHERE typeid = #{typeid}")
    int updatetype(type type);

    @Select("SELECT * FROM type ")
    List<type> getalltype();

}
